{% set pypi_name = 'python-tackerclient' %}
{% set upstream_version = upstream_version('1.4.0') %}
{% set rpm_release = '1' %}
{% set source = url_pypi() %}

Name:           {{ py2name(py_versions='py3') }}
Version:        {{ py2rpmversion() }}
Release:        {{ py2rpmrelease() }}
Summary:        Client API library for Tacker
License:        {{ license('Apache-2.0') }}
Group:          Development/Languages/Python
URL:            https://docs.openstack.org/{{ pypi_name }}
Source0:        {{ source }}
BuildRequires:  openstack-macros
BuildRequires:  {{ py3('cliff') }}
BuildRequires:  {{ py3('ddt') }}
BuildRequires:  {{ py3('fixtures') }}
BuildRequires:  {{ py3('python-keystoneclient') }}
BuildRequires:  {{ py3('mock') }}
BuildRequires:  {{ py3('osc-lib') }}
BuildRequires:  {{ py3('oslo.i18n') }}
BuildRequires:  {{ py3('oslo.log') }}
BuildRequires:  {{ py3('oslo.serialization') }}
BuildRequires:  {{ py3('python-subunit') }}
BuildRequires:  {{ py3('requests-mock') }}
BuildRequires:  {{ py3('stestr') }}
Requires:       {{ py3('Babel') }}
Requires:       {{ py3('cliff') }}
Requires:       {{ py3('iso8601') }}
Requires:       {{ py3('python-keystoneclient') }}
Requires:       {{ py3('netaddr') }}
Requires:       {{ py3('osc-lib') }}
Requires:       {{ py3('oslo.i18n') }}
Requires:       {{ py3('oslo.log') }}
Requires:       {{ py3('oslo.serialization') }}
Requires:       {{ py3('oslo.utils') }}
Requires:       {{ py3('pbr') }}
Requires:       {{ py3('requests') }}
Requires:       {{ py3('simplejson') }}
Requires:       {{ py3('six') }}
Requires:       {{ py3('stevedore') }}
BuildArch:      noarch

%description
OpenStack tacker client

%package doc
Summary:        Documentation for OpenStack tacker client
Group:          Documentation/HTML
BuildRequires:  {{ py3('Sphinx') }}
BuildRequires:  {{ py3('openstackdocstheme') }}
BuildRequires:  {{ py3('reno') }}

%description doc
OpenStack tacker client.

This package contains the documentation.

%prep
%autosetup -p1 -n {{ pypi_name }}-%{version}
%py_req_cleanup

%build
%{py3_build}

# Build HTML docs and man page
PBR_VERSION=%{version} %sphinx_build -b html doc/source doc/build/html
rm -rf doc/build/html/.{doctrees,buildinfo}

%install
%{py3_install}

%check
%{__python3} -m stestr.cli run

%files
%doc README.rst
%license LICENSE
%{python3_sitelib}/tackerclient
%{python3_sitelib}/*.egg-info
%{_bindir}/tacker

%files doc
%doc doc/build/html
%license LICENSE

%changelog
